package errorLayer;

import javax.swing.JOptionPane;

public class DeleteWarning extends JOptionPane {
	
	private boolean answer;
	private String deleteObject;
	
	public DeleteWarning(String item) {
		
		this.deleteObject = item;
		
		displayMessage();
		
	}
	
	private void displayMessage() {
		
		int yesORno = this.showConfirmDialog(getParent(), "Are you sure you want to delete, " + this.deleteObject + "?", "WARNING: Delete", JOptionPane.YES_NO_OPTION);
		
		if (yesORno == 0) {
			answer = true;
		}
		else if (yesORno == 1) {
			answer = false;
		}
		else {
			System.out.println("UHM... not sure " + yesORno);
		}
		
	}
	
	public boolean getAnswer(){
		return answer;
	}

}
